/** http://www.mazelog.com/show?8D */
#include<bits/stdc++.h>
using namespace std;

int mat[6][6] = {
  {4,4,2,2,2,5},
  {5,1,2,3,1,2},
  {3,3,3,2,3,4},
  {2,1,2,2,3,5},
  {3,3,3,3,4,1},
  {4,3,5,2,5,0}
};
bool stamp[6][6];

bool go(int x,int y) {
  if(stamp[x][y]) return false;
  int dis=mat[x][y];
  if(dis==0) return true;

  bool ret=false;

  if(y-dis>=0) {
    ret |= go(x,y-dis);
  }else;
  if(x+dis<6) {
    ret |= go(x+dis, y);
  }else;
  if(y+dis<6) {
    ret |= go(x, y+dis);
  }else;
  if(x-dis>=0) {
    ret |= go(x-dis, y);
  }else;

  return ret;

}

int main() {
  memset(stamp, false, sizeof(stamp));
  return 0;
}